REM*********************************************************** REM*** MEMORY TEST ******************************************* REM*********************************************************** CLS SAY TRANSLATE$("") WindowId=2 GOSUB Openwindow GOSUB ScreenTrick Score=0 ScnWidth=36 Combine$="What is your first name? " GOSUB NarrPrint LINE INPUT ">";FirstName$ Combine$="Please seed my random number generator by pausing briefly and then pressing any key. " GOSUB NarrPrint BuffEmpty WHILE INKEY$="" Seed=Seed+1 IF Seed=32000 THEN Seed=1 WEND RANDOMIZE Seed BuffEmpty Combine$="Type `p' to list the game on your printer. " GOSUB NarrPrint Prnt$="" WHILE Prnt$="" Prnt$=INKEY$ WEND BuffEmpty Combine$="Do you want instructions? Type `y' if so. " GOSUB NarrPrint GOSUB WhatToDo IF Done$="y" THEN f1$(1)="OK, here's how this works. " f1$(2)="Concentrate now. Here's what we're gonna do. " f2$(1)="I'll show " f2$(2)="I'll display " f2$(3)="I'll flash " f3$(1)="a string of characters on the screen. " f3$(2)="a bunch a numbers or letters. " f3$(3)="a pile of stuff in the middle of the screen. " GOSUB RandNum Combine$=f1$(x2)+f2$(x3)+f3$(x3a)+"You type in what you see. No need to type `enter'. " GOSUB NarrPrint END IF Choice=0 WHILE Choice<1 OR Choice>4 BuffEmpty Combine$="Choose a level of difficulty. Type 1 (easy) to 4 (ridiculously difficult). " GOSUB NarrPrint Choice$="" WHILE Choice$="" Choice$=INKEY$ WEND Choice=VAL(Choice$) WEND GoGame: GOSUB Game IF Choice=4 THEN CLS GOSUB ScreenTrick ScnWidth=75 GOSUB CloseWindow END END IF Combine$="Want to try a harder one? Type `y' for yes or another key to end. " GOSUB NarrPrint GOSUB WhatToDo IF Done$="y" THEN Choice=Choice+1 GOTO GoGame END IF CLS ScnWidth=75 GOSUB ScreenTrick GOSUB CloseWindow END REM*********************************************************** MainScreen: 'Screen Display IF Count=1 THEN ColorIt=Yellow Border=Red ELSEIF Count=2 THEN ColorIt=Red Border=Yellow ELSEIF Count=3 THEN ColorIt=Blue Border=Yellow ELSEIF Count=4 THEN ColorIt=Green Border=Red ELSEIF Count=5 THEN ColorIt=Brown Border=Black END IF LINE(0,0)-(319,199),ColorIt,bf FOR i=1 TO 20 LINE(70,118-i)-(240,116+i),0,b Pause(30) NEXT LINE(69,97)-(241,137),Border,b RETURN UpLeftScreen: FOR i=1 TO 10 LINE(10,44-i)-(110,42+i),0,b Pause(50) NEXT LINE(9,33)-(111,53),Border,b RETURN UpRightScreen: FOR i=1 TO 10 LINE(190,44-i)-(290,42+i),0,b Pause(50) NEXT LINE(189,33)-(291,53),Border,b RETURN REM*********************************************************** Game: 'Game module Delay=9600 Count=0 FOR x=1 TO 5 Count=Count+1 ON Choice GOSUB Level1, Level2, Level3, Level4 IF INT(RND*25)=7 THEN CLS Pause(4000) LOCATE 12 PRINT " 246983027548012469832451078951" Pause(Delay) CLS Combine$="Just kidding." GOSUB NarrPrint END IF CLS Pause(4000) LOCATE 12,20-Length/2 PRINT Test$ Pause(Delay) CLS Delay=Delay/2 FOR i=1 TO Length Ans$="" WHILE Ans$="" Ans$=INKEY$ WEND Try$=Try$+Ans$ NEXT i GOSUB ScoreReport BuffEmpty NEXT x CLS RETURN REM**************************************** ScoreReport: f1$(1)="Congratulations " f1$(2)="Magnificent " f1$(3)="You're right " f1$(4)="Very good " f1$(5)="You did it " f1$(6)="Hurray " f2$(1)="Your score is " f2$(2)="Your total score is " f2$(3)="Here's your total score " f2$(4)="Score total is " f3$(1)="You goofed. " f3$(2)="Wrong. " f3$(3)="Nope. " f3$(4)="Error. " f3$(5)="You screwed up. " f3$(6)="You fouled up. " f3$(7)="Uh oh. " f3$(8)="You blew it. " f3$(9)="Stupendous stupidity. " GOSUB RandNum IF Try$=Test$ THEN Combine$=f1$(x6)+FirstName$+". "+f2$(x4) Score=Score+ScoreIncrement ELSE Combine$=f3$(x9)+"Your score is still " END IF GOSUB NarrPrint CLS GOSUB MainScreen LOCATE 15,20-LEN(STR$(Score))/2 PRINT Score PronounceNum(Score) SAY TRANSLATE$(NumPron$) IF Prnt$="p" THEN LPRINT Score: LPRINT Combine$="I said " GOSUB NarrWithLPrint GOSUB UpLeftScreen LOCATE 6,8-Length/2 PRINT Test$ Combine$=Test$ GOSUB NarrWithLPrint Combine$="You typed " GOSUB NarrWithLPrint GOSUB UpRightScreen LOCATE 6,31-Length/2 PRINT Try$ Combine$=Try$+". " GOSUB NarrWithLPrint Pause(5000) RETURN REM********************************************************** Level1: Test$="" Try$="" ScoreIncrement=10 Length=5 FOR i=1 TO 5 Test$=Test$+RIGHT$(STR$(INT(RND*10)),1) NEXT i RETURN REM********************************************************** Level2: Test$="" Try$="" ScoreIncrement=20 Length=6 FOR i=1 TO 6 Test$=Test$+CHR$(INT(RND*26)+97) NEXT i RETURN REM********************************************************** Level3: Test$="" Try$="" ScoreIncrement=50 Length=7 FOR i=1 TO 7 Test$=Test$+RIGHT$(STR$(INT(RND*10)),1) NEXT i RETURN REM********************************************************* Level4: Test$="" Try$="" ScoreIncrement=100 Length=7 FOR i=1 TO 7 Test$=Test$+CHR$(INT(RND*26)+97) NEXT i RETURN REM********************************************************* WhatToDo: Done$="" WHILE Done$="" Done$=INKEY$ WEND RETURN REM********************************************************* SUB Pause(Hold) STATIC FOR i=1 TO Hold NEXT i END SUB REM********************************************************* SUB BuffEmpty STATIC FOR i=1 TO 20 ThrowAway$=INKEY$ NEXT END SUB REM*********************************************************** ScreenTrick: ColorIt=Yellow LINE(5,5)-(319,199),Red,bf FOR i=5 TO 199 LINE(INT(1.6*i),i)-(319-INT(1.6*i),199-i),ColorIt,b IF i=99 THEN ColorIt=Blue NEXT CLS RETURN REM*********************************************************** Openwindow: SCREEN 1,320,200,5,1 WINDOW WindowId,,,,1 GOSUB ColorDef RETURN REM************************************************************ CloseWindow: WindowId=WindowId+1 SCREEN CLOSE 1 RETURN REM************************************************************ ColorDef: DarkBlue=0 White=1 Black=2 Orange=3 Red=5 Yellow=6 LightBlue=7 Brown=9 Green=10 Gray=13 Blue=14 PALETTE Red,1,0.1,0 PALETTE Yellow,1,1,0.13 PALETTE Blue,0.4,0.6,1 PALETTE Brown,0.8,0.6,0.53 PALETTE Green,0.33,0.87,0 PALETTE Gray,0.73,0.73,0.73 PALETTE LightBlue,0.47,0.87,1 RETURN REM*********************************************************** NarrWithLPrint: SAY TRANSLATE$(Combine$) IF Prnt$="p" THEN LPRINT Combine$: LPRINT RETURN REM*********************************************************** REM*** RANDOM NUMBER MODULE ********************************** REM*********************************************************** RandNum: x2=INT(RND*2)+1:x3=INT(RND*3)+1: x4=INT(RND*4)+1: x5=INT(RND*5)+1: x6=INT(RND*6)+1: x7=INT(RND*7)+1: x8=INT(RND*8)+1: x9=INT(RND*9)+1: x10=INT(RND*10)+1 x2a=INT(RND*2)+1: x2b=INT(RND*2)+1 x3a=INT(RND*3)+1: x3b=INT(RND*3)+1: x3c=INT(RND*3)+1 x4a=INT(RND*4)+1: x4b=INT(RND*4)+1 x5a=INT(RND*5)+1: x5b=INT(RND*5)+1: x5c=INT(RND*5)+1 x7a=INT(RND*7)+1: x7b=INT(RND*7)+1 RETURN REM*********************************************************** REM*** NARRATION AND PRINT MODULE **************************** REM*********************************************************** NarrPrint: PRINT Comb$=TRANSLATE$(Combine$) GOSUB FlushLeft IF Prnt$="p" THEN LPRINT Combine$: LPRINT PRINT SAY (Comb$) RETURN REM*********************************************************** FlushLeft: Lines=ScnWidth: StopIt=LEN(Combine$)+1: Pointer=1 WHILE Lines" " THEN WHILE MID$(Combine$,Lines,1)<>" " Lines=Lines-1 WEND PRINT MID$(Combine$,Pointer,Lines-Pointer) Pointer=Lines+1 Lines=Lines+ScnWidth ELSE PRINT MID$(Combine$,Pointer,Lines-Pointer) Pointer=Lines+1 Lines=Lines+ScnWidth END IF WEND PRINT RIGHT$(Combine$,StopIt-Pointer) RETURN REM*********************************************************** REM*** NUMBER PRONUNCIATION ********************************** REM*********************************************************** SUB PronounceNum(NumPron) STATIC SHARED NumPron$ IF NumPron<0 THEN Sign$="neguhtiv " :ELSE Sign$="" Num=ABS(NumPron) IF Num<10 OR Num>=1000 THEN NumPron$=Sign$+STR$(Num): EXIT SUB Hund$="" IF Num<100 THEN Num$=STR$(Num) ELSE Num$=" "+MID$(STR$(Num),3) END IF One$=MID$(Num$,3,1) IF Num>=100 THEN ON FIX(Num/100) GOSUB 100,200,300,400,500,600,700,800,900 IF Num>=10 THEN IF Num>=20 THEN IF One$="0" THEN Fraction$=MID$(Num$,4) ELSE Fraction$=MID$(Num$,3) END IF END IF ON FIX(Num/10) GOSUB 10, 20, 30, 40, 50, 60, 70, 80, 90 ELSEIF Num=0 THEN Pr$="" ELSEIF Num<1 THEN Pr$=MID$(Num$,4) ELSE Pr$=MID$(Num$,3) END IF NumPron$=Sign$+Hund$+Pr$ EXIT SUB 10 Fraction$=MID$(Num$,4) IF One$="0" THEN Pr$="ten " +Fraction$: RETURN IF One$="1" THEN Pr$="eelevven " +Fraction$: RETURN IF One$="2" THEN Pr$="twelve " +Fraction$: RETURN IF One$="3" THEN Pr$="thir-teen " +Fraction$: RETURN IF One$="4" THEN Pr$="for-teen " +Fraction$: RETURN IF One$="5" THEN Pr$="fif-teen " +Fraction$: RETURN IF One$="6" THEN Pr$="six-teen " +Fraction$: RETURN IF One$="7" THEN Pr$="seven-teen "+Fraction$: RETURN IF One$="8" THEN Pr$="ate-teen " +Fraction$: RETURN IF One$="9" THEN Pr$="nine-teen " +Fraction$: RETURN 20 Pr$="twentee " +Fraction$: RETURN 30 Pr$="thirtee " +Fraction$: RETURN 40 Pr$="fortee " +Fraction$: RETURN 50 Pr$="fiftee " +Fraction$: RETURN 60 Pr$="sixtee " +Fraction$: RETURN 70 Pr$="seventee "+Fraction$: RETURN 80 Pr$="ate-ee " +Fraction$: RETURN 90 Pr$="nine-tee "+Fraction$: RETURN 100 Hund$="one hundredd " : Num=Num-100: RETURN 200 Hund$="two hundredd " : Num=Num-200: RETURN 300 Hund$="three hundredd ": Num=Num-300: RETURN 400 Hund$="four hundredd " : Num=Num-400: RETURN 500 Hund$="five hundredd " : Num=Num-500: RETURN 600 Hund$="six hundredd " : Num=Num-600: RETURN 700 Hund$="seven hundredd ": Num=Num-700: RETURN 800 Hund$="ate hundredd " : Num=Num-800: RETURN 900 Hund$="nine hundredd " : Num=Num-900: RETURN END SUB